package com.daka.vo.response.passport;

import com.daka.entity.BaseAddress;
import com.daka.entity.UserPassportApplyOrder;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
 * Created by yangx
 * CreateTime: 2016/10/24 20:00
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class PassportResponseVo {

    private Long id;                //ID
    private String num;             //订单编号
    private Date createTime;        //申请时间
    private Integer applyType;      //申请类型、订单类型 1 首次 2 换发 3 补发
    private String applyTypeStr;
    private Integer applyForm;      //申请方式： 1 在线 2 现场
    private String applyFormStr;
    private String name;            //姓名
    private String cardNo;          //证件号
    private String bassAddressName;     //基地名称
    private String signDate;        //发证日期
    private String mobile;          //手机号
    private String passportNo;      //公益护照编号


    public static PassportResponseVo buildVO(UserPassportApplyOrder aa,BaseAddress baseAddress)  {
        PassportResponseVo passportResponseVo =  new PassportResponseVo();
        passportResponseVo.setId(aa.getId());
        passportResponseVo.setNum(aa.getNum());
        passportResponseVo.setCreateTime(aa.getCreateTime());
        passportResponseVo.setApplyType(aa.getApplyType());
        passportResponseVo.setApplyForm(aa.getApplyForm());
        passportResponseVo.setName(aa.getName());
        passportResponseVo.setCardNo(aa.getCardNo());
        passportResponseVo.setSignDate(aa.getSignDate());
        passportResponseVo.setMobile(aa.getMobile());
        passportResponseVo.setPassportNo(aa.getPassportNo());

        passportResponseVo.setBassAddressName(baseAddress.getName());
        return passportResponseVo;
    }

}
